import { defHttp } from '@/apis/http'
import type { CommonAPI } from '@/apis/schema/all'
/**
 * @description: DNS API
 */
/**
 * @description: 区域
 */

/** 更新区域 */
export const updateApiResolveRegionApi: CommonAPI<
  '/api/resolve/region',
  'put'
> = (data) => defHttp.put(`/api/resolve/region`, { data })

/** 创建区域 */
export const addApiResolveRegionApi: CommonAPI<
  '/api/resolve/region',
  'post'
> = (data) => defHttp.post(`/api/resolve/region`, { data })

/** 删除区域 */
export const deleteApiResolveRegionApi: CommonAPI<
  '/api/resolve/region',
  'delete'
> = (data) => defHttp.delete(`/api/resolve/region`, { data })

/** 查询节点绑定 */
export const getApiResolveRegionNodeBindingsApi: CommonAPI<
  '/api/resolve/region/node-bindings',
  'get'
> = (params) => defHttp.get(`/api/resolve/region/node-bindings`, { params })

/** 查询站点区域绑定信息 */
export const getApiResolveRegionSiteBindingsApi: CommonAPI<
  '/api/resolve/region/site-bindings',
  'get'
> = (params) => defHttp.get(`/api/resolve/region/site-bindings`, { params })

/** 查询区域列表 */
export const getApiResolveRegionsListApi: CommonAPI<
  '/api/resolve/regions',
  'get'
> = (params) => defHttp.get(`/api/resolve/regions`, { params })
